<template>
	<view class="content">
		<!-- <text>我的订单</text> -->
		<view class="tabs">
			<scroll-view scroll-x="true" class="uni-swiper-tab">
				<view v-if="userName=='shengchan'">
					<view :class="['tabs-item',index==5?'tabs-item-tag':'']" @click="chooseTab(5)">上架核查</view>
				</view>
				<view v-if="userName=='cangku'">
					<view :class="['tabs-item',index==1?'tabs-item-tag':'']" @click="chooseTab(1)">上架作业</view>
				</view>
				<view v-else>
					<!-- <view :class="['tabs-item',index==0?'tabs-item-tag':'']" @click="chooseTab(0)">全部</view> -->
					<view :class="['tabs-item',index==1?'tabs-item-tag':'']" @click="chooseTab(1)">上架作业</view>
					<view :class="['tabs-item',index==2?'tabs-item-tag':'']" @click="chooseTab(2)">组托作业</view>
					<view :class="['tabs-item',index==6?'tabs-item-tag':'']" @click="chooseTab(6)">装车作业</view>
					<view :class="['tabs-item',index==3?'tabs-item-tag':'']" @click="chooseTab(3)">库内作业</view>
					<view :class="['tabs-item',index==4?'tabs-item-tag':'']" @click="chooseTab(4)" v-if="specialFlag">
						特殊作业</view>
					<view :class="['tabs-item',index==5?'tabs-item-tag':'']" @click="chooseTab(5)">上架核查</view>
					<view :class="['tabs-item',index==7?'tabs-item-tag':'']" @click="chooseTab(7)">盘点作业</view>
					<view :class="['tabs-item',index==9?'tabs-item-tag':'']" @click="chooseTab(9)">返还待办</view>
					<!-- <view :class="['tabs-item',index==10?'tabs-item-tag':'']" @click="chooseTab(10)">下架待办</view> -->
					<!-- <view :class="['tabs-item',index==8?'tabs-item-tag':'']" @click="chooseTab(8)">委外入库</view> -->
				</view>
			</scroll-view>
		</view>
		<view>
			<view class="button">
				<!-- <view :class="['button-item',buttonIndex==0?'button-item-tag':'']" @click="changeButton(0)">全部</view> -->
				<view :class="['button-item',buttonIndex==2?'button-item-tag':'']" @click="changeButton(2)">进行中</view>
				<view :class="['button-item',buttonIndex==1?'button-item-tag':'']" @click="changeButton(1)">未领取</view>
				<view :class="['button-item',buttonIndex==3?'button-item-tag':'']" @click="changeButton(3)">已完成</view>
			</view>
			<view>
				<scroll-view scroll-y="true" class="scroll-Y">
					<!-- <view :class="[index==0?'item':'']" v-show="index==0">
						<uni-card title="CardNo" extra="AssetsName">
							<text class="uni-body">DocNo</text><br>
							<text class="uni-body">DeptName</text><br>
							<text class="uni-body">Psnname</text><br>
							<text class="uni-body">Category_Name</text>
						</uni-card>
					</view> -->
					<view :class="[index==1?'item':'']" v-show="index==1">
						<view v-for="(item,index) in packageInDatas" :key="index" class="container">
							<uni-card class="dangerMsgbox" :title='item.title'>
								<view @click="packageInClick(item)">
									<!-- <text class="uni-body">标题：{{item.title}}</text><br> -->
									<text class="uni-body" v-if="item.status == 0">状态：未领取</text>
									<text class="uni-body" v-if="item.status == 1">状态：进行中</text>
									<text class="uni-body" v-if="item.status == 3">状态：已完成</text>
									<text class="uni-body" v-if="item.status == 2">状态：已挂起</text><br>
									<text class="uni-body">临时托码：T{{item.pkOrder}}</text><br>
									<text class="uni-body">创建人：{{item.creator}}</text><br>
									<!-- <text class="uni-body">客户标识：{{item.attr2}}</text><br>
									<text class="uni-body">交期：{{item.attr1}}</text><br> -->
									<text class="uni-body uni-mt-5">创建时间：{{item.createTime}}</text><br>
								</view>

								<view slot="actions" class="card-actions">
									<view class="card-actions-item" @click="actionsClickReceive(item)"
										v-if="item.status == 0">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 1">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 3 || item.status == 4">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已完成</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 2">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已挂起</text>
									</view>
									<view class="card-actions-item" @click="actionsClick('挂起',item)"
										v-if="item.status == 0 || item.status == 1 || item.status == 3 || item.status == 4">
										<uni-icons type="cloud-upload" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">挂起</text>
									</view>

									<view class="card-actions-item" @click="actionsClick('恢复',item)"
										v-if="item.status == 2">
										<uni-icons type="cloud-download" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">恢复</text>
									</view>

									<!-- <view class="card-actions-item" @click="transferClick(item)">
										<uni-icons type="staff" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">转单</text>
									</view> -->
								</view>
							</uni-card>
						</view>
					</view>
					<view :class="[index==5?'item':'']" v-show="index==5">
						<view v-for="(item,index) in checkDatas" :key="index" class="container">
							<uni-card class="dangerMsgbox" :title='item.title'>
								<view @click="checkClick(item)">
									<!-- <text class="uni-body">标题：{{item.title}}</text><br> -->
									<text class="uni-body" v-if="item.status == 0">状态：未领取</text>
									<text class="uni-body" v-if="item.status == 1">状态：进行中</text>
									<text class="uni-body" v-if="item.status == 3">状态：已完成</text>
									<text class="uni-body" v-if="item.status == 2">状态：已挂起</text><br>
									<text class="uni-body">临时托码：T{{item.pkOrder}}</text><br>
									<text class="uni-body">创建人：{{item.creator}}</text><br>
									<!-- <text class="uni-body">客户标识：{{item.attr2}}</text><br>
									<text class="uni-body">交期：{{item.attr1}}</text><br> -->
									<text class="uni-body uni-mt-5">创建时间：{{item.createTime}}</text><br>
								</view>

								<view slot="actions" class="card-actions">
									<view class="card-actions-item" @click="actionsClickCheck(item)"
										v-if="item.status == 0">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 1">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 3 || item.status == 4">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已完成</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 2">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已挂起</text>
									</view>
									<view class="card-actions-item" @click="actionsClick('挂起',item)"
										v-if="item.status == 0 || item.status == 1 || item.status == 3 || item.status == 4">
										<uni-icons type="cloud-upload" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">挂起</text>
									</view>

									<view class="card-actions-item" @click="actionsClick('恢复',item)"
										v-if="item.status == 2">
										<uni-icons type="cloud-download" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">恢复</text>
									</view>

									<!-- <view class="card-actions-item" @click="transferClick(item)">
										<uni-icons type="staff" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">转单</text>
									</view> -->
								</view>
							</uni-card>
						</view>
					</view>
					<view :class="[index==2?'item':'']" v-show="index==2">
						<view v-for="(item,index) in packageOutDatas" :key="index" class="container">
							<uni-card class="dangerMsgbox" :title='item.title'>
								<view @click="packageClickOut(item)">
									<!-- <text class="uni-body">标题：{{item.title}}</text><br> -->
									<text class="uni-body" v-if="item.status == 0">状态：未领取</text>
									<text class="uni-body" v-if="item.status == 1">状态：进行中</text>
									<text class="uni-body" v-if="item.status == 3">状态：已完成</text>
									<text class="uni-body" v-if="item.status == 2">状态：挂起</text><br>
									<!-- <text class="uni-body">创建人：{{item.creator}}</text><br> -->
									<text class="uni-body">客户标识：{{item.attr2}}</text><br>
									<text class="uni-body">交期：{{item.attr1}}</text><br>
									<text class="uni-body uni-mt-5">创建时间：{{item.createTime}}</text><br>
								</view>

								<view slot="actions" class="card-actions">
									<view class="card-actions-item" @click="actionsClickOutReceive(item)"
										v-if="item.status == 0">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 1">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 3 || item.status == 4">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已完成</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 2">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已挂起</text>
									</view>
									<view class="card-actions-item" @click="actionsClickOut('挂起',item)"
										v-if="item.status == 0 || item.status == 1 || item.status == 3 || item.status == 4">
										<uni-icons type="cloud-upload" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">挂起</text>
									</view>

									<view class="card-actions-item" @click="actionsClickOut('恢复',item)"
										v-if="item.status == 2">
										<uni-icons type="cloud-download" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">恢复</text>
									</view>

									<!-- <view class="card-actions-item" @click="transferClick(item)">
										<uni-icons type="staff" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">转单</text>
									</view> -->
								</view>
							</uni-card>
						</view>
					</view>
					<view :class="[index==6?'item':'']" v-show="index==6">
						<view v-for="(item,index) in loadingDatas" :key="index" class="container">
							<uni-card class="dangerMsgbox" :title='item.title'>
								<view @click="loadingClickOut(item)">
									<!-- <text class="uni-body">标题：{{item.title}}</text><br> -->
									<text class="uni-body" v-if="item.status == 0">状态：未领取</text>
									<text class="uni-body" v-if="item.status == 1">状态：进行中</text>
									<text class="uni-body" v-if="item.status == 3">状态：已完成</text>
									<text class="uni-body" v-if="item.status == 2">状态：挂起</text><br>
									<!-- <text class="uni-body">创建人：{{item.creator}}</text><br> -->
									<text class="uni-body">客户标识：{{item.attr2}}</text><br>
									<text class="uni-body">交期：{{item.attr1}}</text><br>
									<text class="uni-body uni-mt-5">创建时间：{{item.createTime}}</text><br>
								</view>

								<view slot="actions" class="card-actions">
									<view class="card-actions-item" @click="actionsClickLoadingReceive(item)"
										v-if="item.status == 0">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 1">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 3 || item.status == 4">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已完成</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 2">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已挂起</text>
									</view>
									<view class="card-actions-item" @click="actionsClickOut('挂起',item)"
										v-if="item.status == 0 || item.status == 1 || item.status == 3 || item.status == 4">
										<uni-icons type="cloud-upload" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">挂起</text>
									</view>

									<view class="card-actions-item" @click="actionsClickOut('恢复',item)"
										v-if="item.status == 2">
										<uni-icons type="cloud-download" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">恢复</text>
									</view>

									<!-- <view class="card-actions-item" @click="transferClick(item)">
										<uni-icons type="staff" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">转单</text>
									</view> -->
								</view>
							</uni-card>
						</view>
					</view>
					<view :class="[index==3?'item':'']" v-show="index==3">
						<view v-for="(item,index) in packageDatas" :key="index" class="container">
							<uni-card class="dangerMsgbox" :title='item.title'>
								<view @click="houseIn(item)">
									<!-- <text class="uni-body">标题：{{item.title}}</text><br> -->
									<text class="uni-body" v-if="item.status == 0">状态：未领取</text>
									<text class="uni-body" v-if="item.status == 1">状态：进行中</text>
									<text class="uni-body" v-if="item.status == 3 || item.status == 4">状态：已完成</text>
									<text class="uni-body" v-if="item.status == 2">状态：挂起</text><br>
									<text class="uni-body">创建人：{{item.creator}}</text><br>
									<!-- <text class="uni-body">客户标识：{{item.attr2}}</text><br>
									<text class="uni-body">交期：{{item.attr1}}</text><br> -->
									<text class="uni-body uni-mt-5">创建时间：{{item.createTime}}</text><br>
								</view>

								<view slot="actions" class="card-actions">
									<view class="card-actions-item" @click="houseInReceive(item)"
										v-if="item.status == 0">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 1">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 3 || item.status == 4">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已完成</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 2">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已挂起</text>
									</view>
									<view class="card-actions-item" @click="actionsClickOut('挂起',item)"
										v-if="item.status == 0 || item.status == 1 || item.status == 3 || item.status == 4">
										<uni-icons type="cloud-upload" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">挂起</text>
									</view>

									<view class="card-actions-item" @click="actionsClickOut('恢复',item)"
										v-if="item.status == 2">
										<uni-icons type="cloud-download" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">恢复</text>
									</view>

									<!-- <view class="card-actions-item" @click="transferClick(item)">
										<uni-icons type="staff" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">转单</text>
									</view> -->
								</view>
							</uni-card>
						</view>
					</view>
					<view :class="[index==4?'item':'']" v-show="index==4">
						<view v-for="(item,index) in specialDatas" :key="index" class="container">
							<uni-card class="dangerMsgbox" :title='item.title'>
								<view @click="specialClick(item)">
									<!-- <text class="uni-body">标题：{{item.title}}</text><br> -->
									<text class="uni-body" v-if="item.status == 0">状态：未领取</text>
									<text class="uni-body" v-if="item.status == 1">状态：进行中</text>
									<text class="uni-body" v-if="item.status == 3">状态：同意且完成</text>
									<text class="uni-body" v-if="item.status == 4">状态：拒绝且完成</text>
									<text class="uni-body" v-if="item.status == 2">状态：已挂起</text><br>
									<text class="uni-body">创建人：{{item.creator}}</text><br>
									<!-- <text class="uni-body">客户标识：{{item.attr2}}</text><br>
									<text class="uni-body">交期：{{item.attr1}}</text><br> -->
									<text class="uni-body uni-mt-5">创建时间：{{item.createTime}}</text><br>
								</view>

								<view slot="actions" class="card-actions">
									<view class="card-actions-item" @click="actionsClickSpection(item)"
										v-if="item.status == 0">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 1">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 3 || item.status == 4">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已完成</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 2">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已挂起</text>
									</view>
									<view class="card-actions-item" @click="actionsClick('挂起',item)"
										v-if="item.status == 0 || item.status == 1 || item.status == 3 || item.status == 4">
										<uni-icons type="cloud-upload" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">挂起</text>
									</view>

									<view class="card-actions-item" @click="actionsClick('恢复',item)"
										v-if="item.status == 2">
										<uni-icons type="cloud-download" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">恢复</text>
									</view>

									<!-- <view class="card-actions-item" @click="transferClick(item)">
										<uni-icons type="staff" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">转单</text>
									</view> -->
								</view>
							</uni-card>
						</view>
					</view>
					<view :class="[index==7?'item':'']" v-show="index==7">
						<view v-for="(item,index) in checkOrderDatas" :key="index" class="container">
							<uni-card class="dangerMsgbox" :title='item.title'>
								<view @click="checkOrderClick(item)">
									<!-- <text class="uni-body">标题：{{item.title}}</text><br> -->
									<text class="uni-body" v-if="item.status == 0">状态：未领取</text>
									<text class="uni-body" v-if="item.status == 1">状态：进行中</text>
									<text class="uni-body" v-if="item.status == 3 || item.status == 4">状态：已完成</text>
									<text class="uni-body" v-if="item.status == 2">状态：已挂起</text><br>
									<text class="uni-body">创建人：{{item.creator}}</text><br>
									<!-- <text class="uni-body">客户标识：{{item.attr2}}</text><br>
									<text class="uni-body">交期：{{item.attr1}}</text><br> -->
									<text class="uni-body uni-mt-5">创建时间：{{item.createTime}}</text><br>
									<text class="uni-body uni-mt-5">任务类型：{{item.tasktype}}</text><br>
								</view>

								<view slot="actions" class="card-actions">
									<view class="card-actions-item" @click="actionsClickCheckOrder(item)"
										v-if="item.status == 0">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 1">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 3 || item.status == 4">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已完成</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 2">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已挂起</text>
									</view>
									<view class="card-actions-item" @click="actionsClick('挂起',item)"
										v-if="item.status == 0 || item.status == 1 || item.status == 3 || item.status == 4">
										<uni-icons type="cloud-upload" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">挂起</text>
									</view>

									<view class="card-actions-item" @click="actionsClick('恢复',item)"
										v-if="item.status == 2">
										<uni-icons type="cloud-download" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">恢复</text>
									</view>

									<!-- <view class="card-actions-item" @click="transferClick(item)">
										<uni-icons type="staff" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">转单</text>
									</view> -->
								</view>
							</uni-card>
						</view>
					</view>
					<view :class="[index==8?'item':'']" v-show="index==8">
						<view v-for="(item,index) in outSourcingDatas" :key="index" class="container">
							<uni-card class="dangerMsgbox" :title='item.title'>
								<view @click="outSourcingClick(item)">
									<!-- <text class="uni-body">标题：{{item.title}}</text><br> -->
									<text class="uni-body" v-if="item.status == 0">状态：未领取</text>
									<text class="uni-body" v-if="item.status == 1">状态：进行中</text>
									<text class="uni-body" v-if="item.status == 3 || item.status == 4">状态：已完成</text>
									<text class="uni-body" v-if="item.status == 2">状态：已挂起</text><br>
									<text class="uni-body">创建人：{{item.creator}}</text><br>
									<!-- <text class="uni-body">客户标识：{{item.attr2}}</text><br>
									<text class="uni-body">交期：{{item.attr1}}</text><br> -->
									<text class="uni-body uni-mt-5">创建时间：{{item.createTime}}</text><br>
								</view>

								<view slot="actions" class="card-actions">
									<view class="card-actions-item" @click="actionsOutSourcing(item)"
										v-if="item.status == 0">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 1">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 3 || item.status == 4">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已完成</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 2">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已挂起</text>
									</view>
									<view class="card-actions-item" @click="actionsClick('挂起',item)"
										v-if="item.status == 0 || item.status == 1 || item.status == 3 || item.status == 4">
										<uni-icons type="cloud-upload" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">挂起</text>
									</view>

									<view class="card-actions-item" @click="actionsClick('恢复',item)"
										v-if="item.status == 2">
										<uni-icons type="cloud-download" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">恢复</text>
									</view>

									<!-- <view class="card-actions-item" @click="transferClick(item)">
										<uni-icons type="staff" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">转单</text>
									</view> -->
								</view>
							</uni-card>
						</view>
					</view>

					<view :class="[index==9?'item':'']" v-show="index==9">
						<view v-for="(item,index) in returnWarehouseDatas" :key="index" class="container">
							<uni-card class="dangerMsgbox" :title='item.title'>
								<view @click="returnWarehouseClick(item)">

									<text class="uni-body" v-if="item.status == 0">状态：未领取</text>
									<text class="uni-body" v-if="item.status == 1">状态：进行中</text>
									<text class="uni-body" v-if="item.status == 3 || item.status == 4">状态：已完成</text>
									<text class="uni-body" v-if="item.status == 2">状态：已挂起</text><br>
									<text class="uni-body">创建人：{{item.creator}}</text><br>

									<text class="uni-body uni-mt-5">创建时间：{{item.createTime}}</text><br>
								</view>

								<view slot="actions" class="card-actions">
									<view class="card-actions-item" @click="actionsReturnHouse(item)"
										v-if="item.status == 0">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 1">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 3 || item.status == 4">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已完成</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 2">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已挂起</text>
									</view>
									<view class="card-actions-item" @click="actionsClick('挂起',item)"
										v-if="item.status == 0 || item.status == 1 || item.status == 3 || item.status == 4">
										<uni-icons type="cloud-upload" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">挂起</text>
									</view>

									<view class="card-actions-item" @click="actionsClick('恢复',item)"
										v-if="item.status == 2">
										<uni-icons type="cloud-download" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">恢复</text>
									</view>

									<!-- <view class="card-actions-item" @click="transferClick(item)">
										<uni-icons type="staff" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">转单</text>
									</view> -->
								</view>
							</uni-card>
						</view>
					</view>

					<view :class="[index==10?'item':'']" v-show="index==10">
						<view v-for="(item,index) in dowmshelfDatas" :key="index" class="container">
							<uni-card class="dangerMsgbox" :title='item.title'>
								<view @click="dowmshelfClick(item)">

									<text class="uni-body" v-if="item.status == 0">状态：未领取</text>
									<text class="uni-body" v-if="item.status == 1">状态：进行中</text>
									<text class="uni-body" v-if="item.status == 3 || item.status == 4">状态：已完成</text>
									<text class="uni-body" v-if="item.status == 2">状态：已挂起</text><br>
									<text class="uni-body">创建人：{{item.creator}}</text><br>

									<text class="uni-body uni-mt-5">创建时间：{{item.createTime}}</text><br>
								</view>

								<view slot="actions" class="card-actions">
									<view class="card-actions-item" @click="dowmShelf(item)" v-if="item.status == 0">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 1">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已领取</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 3 || item.status == 4">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已完成</text>
									</view>
									<view class="card-actions-item" v-if="item.status == 2">
										<uni-icons type="checkmarkempty" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">已挂起</text>
									</view>
									<view class="card-actions-item" @click="actionsClick('挂起',item)"
										v-if="item.status == 0 || item.status == 1 || item.status == 3 || item.status == 4">
										<uni-icons type="cloud-upload" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">挂起</text>
									</view>

									<view class="card-actions-item" @click="actionsClick('恢复',item)"
										v-if="item.status == 2">
										<uni-icons type="cloud-download" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">恢复</text>
									</view>

									<!-- <view class="card-actions-item" @click="transferClick(item)">
										<uni-icons type="staff" size="28" color="#999"></uni-icons>
										<text class="card-actions-item-text">转单</text>
									</view> -->
								</view>
							</uni-card>
						</view>
					</view>

				</scroll-view>
			</view>
		</view>


		<uni-popup ref="alertDialog" type="dialog" :is-mask-click="false">
			<uni-popup-dialog mode="input" title="请输入该托的箱数" :value='dataValue' :before-close="true"
				@confirm="alertConfirm" @close="alertClose">
			</uni-popup-dialog>
		</uni-popup>

		<uni-popup ref="commonDialog" type="dialog" :is-mask-click="false">
			<uni-popup-dialog type="success" cancelText="关闭" confirmText="确定" title="提示" :before-close="true"
				:content="commonContent" @confirm="commonConfirm" @close="commonClose">
			</uni-popup-dialog>
		</uni-popup>
	</view>
</template>
<script>
	import {
		getToken
	} from '@/utils/auth';
	import common from '../../pages/common/common.js'
	import {
		geTasktype
	} from '@/api/wmPackage/wmPackage.js'
	var main, receiver, filter;
	var ScanDeviceClass = plus.android.importClass("android.device.ScanDevice");
	var scanDevice;
	export default {
		data() {
			return {
				orgId: getApp().globalData.config.orgId,
				roles: [],
				specialFlag: false,
				shengchanFlag: false,
				cangkuFlag: false,
				baseUrl: getApp().globalData.config.baseUrl,
				userName: this.$store.state.user.name,
				//roles:this.$store.state.user.roles[0],
				// 默认显示0
				index: 1,
				buttonIndex: 2,
				//全部数据
				allDatas: [],
				allDatasCopy: [],
				//入库数据
				packageInDatas: [],
				packageInDatasCopy: [],
				//出库数据，组托专用
				packageOutDatas: [],
				packageOutDatasCopy: [],
				//库内数据
				packageDatas: [],
				packageDatasCopy: [],
				//特殊数据
				specialDatas: [],
				specialDatasCopy: [],
				//装车数据
				loadingDatas: [],
				loadingDatasCopy: [],
				//上架核查数据
				checkDatas: [],
				checkDatasCopy: [],
				//盘点数据
				checkOrderDatas: [],
				checkOrderDatasCopy: [],
				//委外入库数据
				outSourcingDatas: [],
				outSourcingDatasCopy: [],
				// 返还待办
				returnWarehouseDatas: [],
				returnWarehouseDatasCopy: [],
				// 下架待办
				dowmshelfDatas: [],
				dowmshelfDatasCopy: [],
				dataValue: '',
				codeStr: '',
				recptId: '',
				record: '',
				//装车单客户单号
				customerScanNo: '',
				customerScanflag: false,
				delay: 800,
				commonContent: '',
			};
		},
		watch: {

		},

		onLoad() {
			uni.startPullDownRefresh();
		},

		// onPullDownRefresh () {
		// 	// console.log("测试下拉刷新");
		// 	 uni.stopPullDownRefresh()
		// },

		onShow() {
			this.orgId = uni.getStorageSync('orgId');
			this.roles = uni.getStorageSync('roles');
			if (this.roles.includes('admin') || this.roles.includes('deptMgm') || this.roles.includes('removePackage')) {
				this.specialFlag = true;
			} else {
				this.specialFlag = false;
			}
			if (this.userName == 'shengchan') {
				this.index = 5
			} else if (this.userName == 'cangku') {
				this.index = 1
			} else {
				//this.index = 1
			}
			this.chooseTab(this.index);
			scanDevice = new ScanDeviceClass();
			scanDevice.openScan(); // 打开扫描
			scanDevice.setOutScanMode(0); // 扫描模式		
			this.initScan();
			this.registerScan();
		},

		// mounted() {
		// 	this.chooseTab(1);
		// 	scanDevice = new ScanDeviceClass();
		// 	scanDevice.openScan(); // 打开扫描
		// 	scanDevice.setOutScanMode(0); // 扫描模式		
		// 	this.initScan();
		// 	this.registerScan();
		// },

		onHide: function() {
			this.unregisterScan();
		},

		destroyed: function() {
			this.unregisterScan();
		},

		methods: {
			initScan() {
				let _this = this;
				main = plus.android.runtimeMainActivity(); //获取activity  
				var IntentFilter = plus.android.importClass('android.content.IntentFilter');
				filter = new IntentFilter();
				filter.addAction("scan.rcv.message"); // 换你的广播动作  
				receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', {
					onReceive: function(context, intent) {
						plus.android.importClass(intent);
						let code = intent.getByteArrayExtra('barocode');
						let codeStr = common.utf8ByteToUnicodeStr(code);
						scanDevice.stopScan(); // 停止扫描	
						_this.buttonScan(codeStr);
					}
				});
			},

			registerScan() {
				main.registerReceiver(receiver, filter);
			},

			unregisterScan() {
				main.unregisterReceiver(receiver);
			},

			buttonScan(codeStr) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				if (that.index == 1) { //入库作业
					that.queryRecptByCode(codeStr);
				} else if (that.index == 2) { //组托作业
					that.queryPackageId(codeStr);
				} else if (that.index == 6) { //装车作业
					that.queryLoadingData(codeStr);
				}
			},

			buttonScanOld(codeStr) {
				var that = this;
				if (that.index == 1) { //入库作业
					if (that.packageInDatas.length == 0) {
						uni.showToast({
							title: '入库作业没有该临时托',
							icon: 'none',
							duration: 2000
						});
						return;
					}
					var flag = false;
					var data = '';
					for (var i = 0; i < that.packageInDatas.length; i++) {
						data = that.packageInDatas[i];
						if (('T' + data.pkOrder) == codeStr) {
							flag = true;
							break;
						}
					}
					if (flag) {
						if (data.status == 0) {
							this.record = data;
							this.recptId = data.pkOrder;
							this.$refs.alertDialog.open();
						} else {
							var url = '/pages/work/product_recpt?pkOrder=' + data.pkOrder + "&status=" + data.status +
								"&title=" + data.title + "&id=" + data.id + "&index=" + this.index;
							uni.navigateTo({
								url: url
							});
						}
					}
				} else if (that.index == 2) { //组托作业
					if (that.packageOutDatas.length == 0) {
						uni.showToast({
							title: '组托作业没有数据',
							icon: 'none',
							duration: 2000
						});
						return;
					}
					that.queryPackageId(codeStr);
				} else if (that.index == 6) { //装车作业
					//    if(this.customerScanflag){
					// 	this.customerScanNo = codeStr;
					// 	this.customerScanflag = false;
					// }else{
					// 	if(that.loadingDatasCopy == 0){
					// 		uni.showToast({
					// 			title: '装车作业没有数据',
					// 			icon: 'none',
					// 			duration: 2000
					// 		});
					// 		return;
					// 	}
					// 	that.queryLoadingData(codeStr);
					// }
					if (that.loadingDatasCopy == 0) {
						uni.showToast({
							title: '装车作业没有数据',
							icon: 'none',
							duration: 2000
						});
						return;
					}
					that.customerScanflag = true;
					that.queryLoadingData(codeStr);
				}
			},

			queryRecptByCode(codeStr) {
				var that = this;
				uni.request({
					url: that.baseUrl + '/system/wmsbacklog/findByCode',
					data: {
						category: 'comehouse',
						username: that.userName,
						role_key: that.roles,
						pkOrder: codeStr.substring(1, codeStr.length)
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						uni.hideLoading();
						if (res.data.code == '200' || res.data.code == 200) {
							var total = res.data.total;
							if (total <= 0) {
								that.commonContent = '入库作业没有该临时托';
								that.$refs.commonDialog.open();
							} else {
								var data = res.data.rows[0];
								if (data.status == 0) {
									that.record = data;
									that.recptId = data.pkOrder;
									that.$refs.alertDialog.open();
								} else {
									var url = '/pages/work/product_recpt?pkOrder=' + data.pkOrder +
										"&status=" + data.status + "&title=" + data.title + "&id=" + data.id +
										"&index=" + this.index;
									uni.navigateTo({
										url: url
									});
								}
							}

						} else {
							var message = res.data.msg;
							if (message == null || message == '') {
								message = '查询失败';
							}
							that.commonContent = message;
							that.$refs.commonDialog.open();
							return;
						}

					},
				})
			},

			queryPackageId(content) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				uni.request({
					url: this.baseUrl + "/system/record/packageid/panelcodes",
					data: {
						content: content.substring(1, content.length),
						userName: this.userName,
						orgId: this.orgId,
						//receiptNot:''
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						if (res.data.code == '200' || res.data.code == 200) {
							console.log(res.data);
							var data = res.data.data;
							var url = '/pages/wm_package/wm_package?pkOrder=' + data.pkOrder + "&status=" +
								data.status + "&title=" + data.title + "&id=" + data.id + "&index=" + this
								.index;
							uni.navigateTo({
								url: url
							});
							uni.hideLoading();
						} else {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							return;
						}

					},
				})
			},

			queryLoadingData(codeStr) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				uni.request({
					url: this.baseUrl + "/system/loading/truckId",
					data: {
						packageNo: codeStr,
						userName: this.userName,
						orgId: this.orgId,
						type: "scan"
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						console.log(res.data);
						if (res.data.code == '200' || res.data.code == 200) {
							var data = res.data.data;
							if (data.status == '0') {
								this.actionsClickLoadingReceive(data);
							} else {
								var url = '/pages/wm_truck/wm_truck_loading?salseId=' + data.pkOrder +
									"&status=" + data.status + "&title=" + data.title + "&id=" + data.id +
									"&index=" + this.index +
									"&customerScanNo=" + this.customerScanNo + "&lastStatus=" + data.status;
								uni.navigateTo({
									url: url
								});
							}
						} else {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							return;
						}

					},
				})
			},

			changeButton(buttonIndex) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				this.buttonIndex = buttonIndex;
				this.chooseTab(this.index);
				// if(buttonIndex == 0){
				// 	this.allData();
				// }else if(buttonIndex == 1){
				// 	this.notClaimed();
				// }else if(buttonIndex == 2){
				// 	this.inHand();
				// }else if(buttonIndex == 3){
				// 	this.completed();
				// }

			},

			// 切换
			chooseTab(index) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				that.index = index;
				//that.buttonIndex = 2;
				var url = that.baseUrl + '/system/wmsbacklog/wb3';
				var type = '';
				//var receiptNot='';
				if (that.index == 1) { //入库,
					//url = url+'/system/wmsbacklog/wb1';
					type = 'comehouse';
				} else if (that.index == 2) { //出库
					//url = url+'/system/wmsbacklog/wb1';
					type = 'package';
				} else if (that.index == 3) { //库内
					//url = url+'/system/wmsbacklog/wb1';
					type = 'housein';
				} else if (that.index == 4) { //特殊
					//url = url+'/system/wmsbacklog/wb1';
					type = 'special';
				} else if (that.index == 5) {
					//url = url+'/system/wmsbacklog/wb1';
					type = 'check';
				} else if (that.index == 6) {
					//url = url+'/system/wmsbacklog/wb1';
					type = 'loading';
				} else if (that.index == 7) {
					//url = url+'/system/wmsbacklog/wb1';
					type = 'checkOrder';
				} else if (that.index == 8) {
					//url = url+'/system/wmsbacklog/wb1';
					type = 'outsourcing';
				} else if (that.index == 9) {
					//url = url+'/system/wmsbacklog/wb1';
					type = 'fanhuan';
				} else if (that.index == 10) {
					type = '';
				} else { //全部
					//url = url+'/system/wmsbacklog/wb1';
					type = 'all';
				}
				var excuteType = "inHand";
				if (that.buttonIndex == 1) {
					excuteType = "notClaimed";
				} else if (that.buttonIndex == 3) {
					excuteType = "completed";
				}
				console.log(type)
				console.log(that.userName)
				console.log(that.roles)
				console.log(excuteType)
				uni.request({
					url: url,
					data: {
						category: type,
						username: that.userName,
						role_key: that.roles,
						excuteType: excuteType
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						console.log(res)
						if (res.data.code == '200' || res.data.code == 200) {
							//隐藏加载框
							uni.hideLoading();
							if (that.index == 1) {
								//that.packageInDatas = res.data.rows;
								that.packageInDatas = [];
								that.packageInDatasCopy = res.data.rows;
								that.delayloadDp(that.packageInDatasCopy, 5, 0, that.delay, that
									.packageInDatas);
							} else if (that.index == 2) {
								//that.packageOutDatas = res.data.rows;
								that.packageOutDatas = [];
								that.packageOutDatasCopy = res.data.rows;
								that.delayloadDp(that.packageOutDatasCopy, 5, 0, that.delay, that
									.packageOutDatas);
							} else if (that.index == 3) {
								//that.packageDatas = res.data.rows;
								that.packageDatas = [];
								that.packageDatasCopy = res.data.rows;
								that.delayloadDp(that.packageDatasCopy, 5, 0, that.delay, that.packageDatas);
							} else if (that.index == 4) {
								//that.specialDatas = res.data.rows;
								that.specialDatas = [];
								that.specialDatasCopy = res.data.rows;
								that.delayloadDp(that.specialDatasCopy, 5, 0, that.delay, that.specialDatas);
							} else if (that.index == 5) {
								//that.checkDatas = res.data.rows;
								that.checkDatas = [];
								that.checkDatasCopy = res.data.rows;
								that.delayloadDp(that.checkDatasCopy, 5, 0, that.delay, that.checkDatas);
							} else if (that.index == 6) {
								//that.loadingDatas = res.data.rows;
								that.loadingDatas = [];
								that.loadingDatasCopy = res.data.rows;
								that.delayloadDp(that.loadingDatasCopy, 5, 0, that.delay, that.loadingDatas);
							} else if (that.index == 7) {
								//that.checkOrderDatas = res.data.rows;
								that.checkOrderDatas = [];
								console.log(res.data.rows)
								console.log(that.checkOrderDatas)

								var list = []
								res.data.rows.forEach(item => {
									list.push(item.pkOrder)
								})
								console.log(list)
								this.getTaskType(list)
								that.checkOrderDatasCopy = res.data.rows;
								// that.delayloadDp(that.checkOrderDatasCopy, 5, 0, that.delay, that.checkOrderDatas);
							} else if (that.index == 8) {
								//that.outSourcingDatas = res.data.rows;
								that.outSourcingDatas = [];
								that.outSourcingDatasCopy = res.data.rows;
								that.delayloadDp(that.outSourcingDatasCopy, 5, 0, that.delay, that
									.outSourcingDatas);
							} else if (that.index == 9) {
								console.log(res.data.rows)
								// returnWarehouseDatasCopy
								that.returnWarehouseDatas = [];
								that.returnWarehouseDatasCopy = res.data.rows;
								that.delayloadDp(that.returnWarehouseDatasCopy, 5, 0, that.delay, that
									.returnWarehouseDatas);
							} else if (that.index == 10) {
								console.log(res.data.rows)
								that.dowmshelfDatas = []
								that.dowmshelfDatasCopy = res.data.rows;

								that.delayloadDp(that.dowmshelfDatasCopy, 5, 0, that.delay, that
									.dowmshelfDatas);
							} else {
								//that.allDatas = res.data.rows;
								that.allDatas = [];
								that.allDatasCopy = res.data.rows;
								that.delayloadDp(that.allDatasCopy, 5, 0, that.delay, that.allDatas);
							}
							//that.changeButton(that.buttonIndex);

						} else {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							return;
						}

					},
				})
			},
			// 获取任务类型
			getTaskType(data) {
				// console.log('getTaskType',data)
			
				// console.log(data)
				// let obj= {

				// }
				// obj.pkOrder = data
				// geTasktype(data).then(res=>{
				// 	console.log(res)
				// })
				uni.request({
					url: this.baseUrl + '/system/WmsCheckOrder/getCheckPlanByCheckOrderIds',
					data: data,
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						console.log(res)
						if (res.data.code == '200' || res.data.code == 200) {
							if(res.data.data){
								res.data.data.forEach(item=>{
								
									this.checkOrderDatasCopy.forEach(items=>{
										if(items.pkOrder == item.pkOrder){
											
											
											if(item.orignCheckDiffId == undefined || item.orignCheckDiffId == ''){
												items.tasktype = '初盘'
											}else{
												items.tasktype = '复盘'
											}
										}
									})
								})
								console.log(this.checkOrderDatasCopy)
								this.delayloadDp(this.checkOrderDatasCopy, 5, 0, this.delay, this.checkOrderDatas);
								
								
								
							}
							
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							return;
						}

					},
				})
			},


			//产成品入库领取专用
			actionsClickReceive(item) {
				if (item.status == 0) {
					this.record = item;
					this.recptId = item.pkOrder;
					this.$refs.alertDialog.open();
				} else {
					//隐藏加载框
					uni.hideLoading();
					this.chooseTab(this.index);
					var url = '/pages/work/product_recpt?pkOrder=' + item.pkOrder + "&status=1" + "&title=" + item.title +
						"&id=" + item.id + "&index=" + this.index;
					uni.navigateTo({
						url: url
					});
				}
			},
			// 返还代办领取专用
			actionsReturnHouse(item) {
				// if (item.status == 0) {
				// 	this.record = item;
				// 	this.recptId = item.pkOrder;
				// 	this.$refs.alertDialog.open();
				// } else {
				// 	//隐藏加载框
				// 	uni.hideLoading();
				// 	this.chooseTab(this.index);
				// 	var url = '/pages/work/return_warehouse?pkOrder=' + item.pkOrder + "&status=1" + "&title=" + item.title +
				// 		"&id=" + item.id + "&index=" + this.index;
				// 	uni.navigateTo({
				// 		url: url
				// 	});
				// }
				console.log(item)
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				uni.request({
					url: this.baseUrl + '/system/wmsbacklog/update',
					data: {
						id: item.id,
						status: '1',
						executor: this.userName,
						orgId: this.orgId,
						startTime: new Date().toISOString().slice(0, 10),
						endTime: '',
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						//隐藏加载框
						uni.hideLoading();
						console.log(res)
						if (res.data.code == '200' || res.data.code == 200) {
							var url = '/pages/work/return_warehouse?pkOrder=' + item.pkOrder +
								"&status=" + item.status + "&title=" + item.title + "&id=" + item.id +
								"&index=" + this.index;
							uni.navigateTo({
								url: url
							});
							this.chooseTab(this.index);
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							return;
						}

					},
				})
			},
			// 上架待办领取专用
			dowmShelf() {

			},

			//上架核查
			actionsClickCheck(item) {
				
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				uni.request({
					url: this.baseUrl + '/system/wmsbacklog/update',
					data: {
						id: item.id,
						status: '1',
						executor: this.userName,
						orgId: this.orgId,
						startTime: new Date().toISOString().slice(0, 10),
						endTime: '',
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						//隐藏加载框
						uni.hideLoading();
						if (res.data.code == '200' || res.data.code == 200) {
							var url = '/pages/product_recpt/product_recpt_check?pkOrder=' + item.pkOrder +
								"&status=" + item.status + "&title=" + item.title + "&id=" + item.id +
								"&index=" + this.index;
							uni.navigateTo({
								url: url
							});
							this.chooseTab(this.index);
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							return;
						}

					},
				})
			},

			actionsClickSpection(item) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				uni.request({
					url: this.baseUrl + '/system/wmsbacklog/update',
					data: {
						id: item.id,
						status: '1',
						executor: this.userName,
						orgId: this.orgId,
						startTime: new Date().toISOString().slice(0, 10),
						endTime: '',
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						//隐藏加载框
						uni.hideLoading();
						if (res.data.code == '200' || res.data.code == 200) {
							var url = '';
							if (item.title.includes('越库')) {
								url = '/pages/special/overStockDetail?pkOrder=' + item.pkOrder + "&status=" +
									item.status + "&title=" + item.title + "&id=" + item.id + "&index=" + this
									.index;
							} else if (item.title.includes('拆托')) {
								url = '/pages/remove_bracket/wm_unpanel_line_detaile?pkOrder=' + item.pkOrder +
									"&status=" + item.status + "&title=" + item.title + "&id=" + item.id +
									"&index=" + this.index;
							}
							uni.navigateTo({
								url: url
							});
							this.chooseTab(this.index);
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							return;
						}

					},
				})
			},
			//盘点领取专用
			actionsClickCheckOrder(item) {
				console.log('item!!!!!!!!!!!',item)
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				uni.request({
					url: this.baseUrl + '/system/wmsbacklog/update',
					data: {
						id: item.id,
						status: '1',
						executor: this.userName,
						orgId: this.orgId,
						startTime: new Date().toISOString().slice(0, 10),
						endTime: '',
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						//隐藏加载框
						uni.hideLoading();
						if (res.data.code == '200' || res.data.code == 200) {
							this.updatecheckOrderData(item);
							var url = '/pages/special/wms_check_order?pkOrder=' + item.pkOrder + "&status=" +
								item.status + "&title=" + item.title + "&id=" + item.id + "&index=" + this
								.index +"&tasktype=" + item.tasktype;
							uni.navigateTo({
								url: url
							});
							this.chooseTab(this.index);
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							return;
						}

					},
				})
			},

			actionsOutSourcing(item) {

			},

			updatecheckOrderData(item) {
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				uni.request({
					url: that.baseUrl + '/system/WmsCheckOrder/checkLine/receive/' + item.pkOrder,
					data: {
						orgId: that.orgId,
						userName: that.userName,
					},
					method: 'PUT',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						//隐藏加载框
						uni.hideLoading();
						if (res.data.code == '200' || res.data.code == 200) {
							uni.hideLoading();
						} else {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 5000
							});
							return;
						}

					},
				})
			},


			actionsClick(type, item) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var status = '';
				if (type == "挂起") {
					if (item.status == '0') {
						//隐藏加载框
						uni.hideLoading();
						uni.showToast({
							title: '此待办未领取，不能挂起！',
							icon: 'none',
							duration: 2000
						});
						return;
					}

					if (item.status == '3' || item.status == '4') {
						//隐藏加载框
						uni.hideLoading();
						uni.showToast({
							title: '此待办已完成，不能挂起！',
							icon: 'none',
							duration: 2000
						});
						return;
					}
					status = '2';
				} else if (type == "恢复") {
					if (item.status == '0') {
						//隐藏加载框
						uni.hideLoading();
						uni.showToast({
							title: '此待办未领取，不能恢复！',
							icon: 'none',
							duration: 2000
						});
						return;
					}
					if (item.status == '3') {
						//隐藏加载框
						uni.hideLoading();
						uni.showToast({
							title: '此待办已完成，不能恢复！',
							icon: 'none',
							duration: 2000
						});
						return;
					}
					status = '1';
				}
				if (status == null || status == "") {
					//隐藏加载框
					uni.hideLoading();
					return;
				}
				uni.request({
					url: this.baseUrl + '/system/wmsbacklog/update',
					data: {
						id: item.id,
						status: status,
						executor: this.userName,
						orgId: this.orgId,
						startTime: '',
						endTime: '',
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						//隐藏加载框
						uni.hideLoading();
						if (res.data.code == '200' || res.data.code == 200) {
							this.chooseTab(this.index);
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							return;
						}

					},
				})
			},

			//产成品入库点击卡片进入待办任务详情
			packageInClick(item) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				if (item.status == '0') {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '请先领取任务',
						icon: 'none',
						duration: 3000
					});
					return;
				}
				var url = '';
				console.log(item)
				if (item.title.includes('产成品入库')) {
					url = '/pages/work/product_recpt?pkOrder=' + item.pkOrder + "&status=" + item.status + "&title=" + item
						.title + "&id=" + item.id + "&index=" + this.index;
				}
				//隐藏加载框
				uni.hideLoading();
				uni.navigateTo({
					url: url
				});

			},

			//上架核查点击卡片进入待办任务详情
			checkClick(item) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				if (item.status == '0') {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '请先领取任务',
						icon: 'none',
						duration: 3000
					});
					return;
				}
				var url = '/pages/product_recpt/product_recpt_check?pkOrder=' + item.pkOrder + "&status=" + item.status +
					"&title=" + item.title + "&id=" + item.id + "&index=" + this.index;
				//隐藏加载框
				uni.hideLoading();
				uni.navigateTo({
					url: url
				});
			},

			specialClick(item) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				if (item.status == '0') {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '请先领取任务',
						icon: 'none',
						duration: 3000
					});
					return;
				}
				var url = '';
				if (item.title.includes('越库')) {
					url = '/pages/special/overStockDetail?pkOrder=' + item.pkOrder + "&status=" + item.status + "&title=" +
						item.title + "&id=" + item.id + "&index=" + this.index;
				} else if (item.title.includes('拆托')) {
					url = '/pages/remove_bracket/wm_unpanel_line_detaile?pkOrder=' + item.pkOrder + "&status=" + item
						.status + "&title=" + item.title + "&id=" + item.id + "&index=" + this.index;
				}
				//隐藏加载框
				uni.hideLoading();
				uni.navigateTo({
					url: url
				});
			},

			//盘点作业
			checkOrderClick(item) {
				uni.setStorageSync('tasktype',item.tasktype)
				console.log('item111111111111111',item)
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				if (item.status == '0') {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '请先领取任务',
						icon: 'none',
						duration: 3000
					});
					return;
				}
				console.log(item,'item')
				
				uni.setStorageSync('tasktype',item.tasktype)
				uni.setStorageSync('pkOrder',item.pkOrder)
				var url = '/pages/special/wms_check_order?pkOrder=' + item.pkOrder + "&status=" + item.status + "&title=" +
					item.title + "&id=" + item.id + "&index=" + this.index +"&tasktype=" + item.tasktype;
				//隐藏加载框
				uni.hideLoading();
				uni.navigateTo({
					url: url
				});
			},

			//委外入库
			outSourcingClick(item) {

			},

			//组托点击卡片进入待办任务详情
			packageClickOut(item) {
				console.log(item)
				// 20240204判断组托计划锁定
				if (item.isLock == 1) {
					uni.showToast({
						duration: 4000,
						icon: 'none',
						title: '该组托计划正在做变更已被锁定,不允许操作!'
					})
				} else {

					//显示加载框
					uni.showLoading({
						title: '加载中',
						mask: true
					});
					if (item.status == '0') {
						//隐藏加载框
						uni.hideLoading();
						uni.showToast({
							title: '请先领取任务',
							icon: 'none',
							duration: 3000
						});
						return;
					}
					if (item.attr3 == '冻结') {
						//隐藏加载框
						uni.hideLoading();
						uni.showToast({
							title: '此待办任务正在变更中',
							icon: 'none',
							duration: 4000
						});
						return;
					}
					var url = '';
					if (item.title.includes('组托计划')) {
						url = '/pages/wm_package/wm_package?pkOrder=' + item.pkOrder + "&status=" + item.status +
							"&title=" +
							item.title + "&id=" + item.id + "&index=" + this.index;
					}
					uni.navigateTo({
						url: url
					});
				}
				//隐藏加载框
				uni.hideLoading();
			},

			//装车点击卡片进入待办任务详情
			loadingClickOut(item) {

				// 20240205判断组托计划锁定
				if (item.isLock == 1) {
					uni.showToast({
						duration: 4000,
						icon: 'none',
						title: '该组托计划正在做变更已被锁定,不允许操作!'
					})
				} else {
					//显示加载框
					uni.showLoading({
						title: '加载中',
						mask: true
					});
					if (item.status == '0') {
						//隐藏加载框
						uni.hideLoading();
						uni.showToast({
							title: '请先领取任务',
							icon: 'none',
							duration: 3000
						});
						return;
					}
					var url = '';
					if (item.title.includes('装车')) {
						url = '/pages/wm_truck/wm_truck_loading?salseId=' + item.pkOrder + "&status=" + item.status +
							"&title=" + item.title + "&id=" + item.id + "&index=" + this.index +
							"&customerScanNo=" + '' + "&lastStatus=" + item.status;
					}
					uni.navigateTo({
						url: url
					});
				}
				//隐藏加载框
				uni.hideLoading();

			},

			//库内操作点击卡片进入待办任务详情
			houseIn(item) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				if (item.status == '0') {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '请先领取任务',
						icon: 'none',
						duration: 3000
					});
					return;
				}
				var url = '';
				if (item.title.includes('杂收')) {
					url = '/pages/special/wm_misc_rcv_trans?pkOrder=' + item.pkOrder + "&status=" + item.status +
						"&title=" + item.title + "&id=" + item.id + "&index=" + this.index;
				} else if (item.title.includes('杂发')) {
					url = '/pages/special/wm_msic_ship?pkOrder=' + item.pkOrder + "&status=" + item.status + "&title=" +
						item.title + "&id=" + item.id + "&index=" + this.index;
				} else if (item.title.includes('返工入库') || item.title.includes('调入')) {
					url = '/pages/product_recpt/reworkIn?pkOrder=' + item.pkOrder + "&status=" + item.status + "&title=" +
						item.title + "&id=" + item.id + "&index=" + this.index;
				} else if (item.title.includes('返工出库') || item.title.includes('调出')) {
					url = '/pages/product_recpt/reworkOut?pkOrder=' + item.pkOrder + "&status=" + item.status + "&title=" +
						item.title + "&id=" + item.id + "&index=" + this.index;
				} //else if(item.title.includes('调入')){
				// 	url = '/pages/special/wm_transfer_in?pkOrder='+item.pkOrder+"&status="+item.status+"&title="+item.title+"&id="+item.id+"&index="+this.index;
				// }else if(item.title.includes('调出')){
				// 	url = '/pages/special/wm_transfer_out?pkOrder='+item.pkOrder+"&status="+item.status+"&title="+item.title+"&id="+item.id+"&index="+this.index;
				// }
				//隐藏加载框
				uni.hideLoading();
				uni.navigateTo({
					url: url
				});
			},

			//组托领取专用
			actionsClickOutReceive(item) {
				//20240204判断组托计划锁定
				if (item.isLock == 1) {
					uni.showToast({
						duration: 4000,
						icon: 'none',
						title: '该组托计划正在做变更已被锁定,不允许操作!'
					})
				} else {
					//显示加载框
					uni.showLoading({
						title: '加载中',
						mask: true
					});
					uni.request({
						url: this.baseUrl + '/system/wmsbacklog/update',
						data: {
							id: item.id,
							status: '1',
							executor: this.userName,
							orgId: this.orgId,
							startTime: new Date().toISOString().slice(0, 10),
							endTime: '',
						},
						method: 'POST',
						header: {
							'authorization': getToken()
						},
						dataType: 'json',
						success: (res) => {
							if (res.data.code == '200' || res.data.code == 200) {
								this.chooseTab(this.index);
								var url = '';
								if (item.title.includes('组托计划')) {
									url = '/pages/wm_package/wm_package?pkOrder=' + item.pkOrder + "&status=" +
										item.status + "&title=" + item.title + "&id=" + item.id + "&index=" +
										this
										.index;
								}
								// if(item.title.includes('装车')){
								// 	url = '/pages/wm_truck/wm_truck_loading?salseId='+item.pkOrder+"&status="+item.status+"&title="+item.title+"&id="+item.id+"&index="+this.index;
								// }
								uni.navigateTo({
									url: url
								});
								//隐藏加载框
								uni.hideLoading();
							} else {
								//隐藏加载框
								uni.hideLoading();
								uni.showToast({
									title: res.data.msg,
									icon: 'none',
									duration: 2000
								});
								return;
							}

						},
					})
				}
			},

			//装车领取专用
			actionsClickLoadingReceive(item) {
				//20240205判断组托计划锁定
				if (item.isLock == 1) {
					uni.showToast({
						duration: 4000,
						icon: 'none',
						title: '该组托计划正在做变更已被锁定,不允许操作!'
					})
				} else {
					//显示加载框
					uni.showLoading({
						title: '加载中',
						mask: true
					});
					// if(this.customerScanNo == null || this.customerScanNo == ''){
					// 	this.customerScanflag = true;
					// 	uni.showToast({
					// 		title: '请先扫描客户手中的二维码信息',
					// 		icon: 'none',
					// 		duration: 5000
					// 	});
					// 	return;
					// }
					uni.request({
						url: this.baseUrl + '/system/wmsbacklog/update',
						data: {
							id: item.id,
							status: '1',
							executor: this.userName,
							orgId: this.orgId,
							startTime: new Date().toISOString().slice(0, 10),
							endTime: '',
						},
						method: 'POST',
						header: {
							'authorization': getToken()
						},
						dataType: 'json',
						success: (res) => {
							//隐藏加载框
							uni.hideLoading();
							if (res.data.code == '200' || res.data.code == 200) {
								this.chooseTab(this.index);
								var url = '';
								// if(item.title.includes('组托计划')){
								// 	url = '/pages/wm_package/wm_package?pkOrder='+item.pkOrder+"&status="+item.status+"&title="+item.title+"&id="+item.id+"&index="+this.index;
								// }
								if (!this.customerScanflag) {
									this.customerScanNo = "";
								}
								this.customerScanflag = false;
								if (item.title.includes('装车')) {
									url = '/pages/wm_truck/wm_truck_loading?salseId=' + item.pkOrder +
										"&status=" +
										item.status + "&title=" + item.title + "&id=" + item.id + "&index=" +
										this
										.index + "&customerScanNo=" + this.customerScanNo + "&lastStatus=0";
								}
								uni.navigateTo({
									url: url
								});
							} else {
								uni.showToast({
									title: res.data.msg,
									icon: 'none',
									duration: 2000
								});
								return;
							}

						},
					})
				}
			},

			houseInReceive(item) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				uni.request({
					url: this.baseUrl + '/system/wmsbacklog/update',
					data: {
						id: item.id,
						status: '1',
						executor: this.userName,
						orgId: this.orgId,
						startTime: new Date().toISOString().slice(0, 10),
						endTime: '',
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						//隐藏加载框
						uni.hideLoading();
						if (res.data.code == '200' || res.data.code == 200) {
							this.chooseTab(this.index);
							var url = '';
							if (item.title.includes('杂收')) {
								url = '/pages/special/wm_misc_rcv_trans?pkOrder=' + item.pkOrder + "&status=" +
									item.status + "&title=" + item.title + "&id=" + item.id + "&index=" + this
									.index;
							} else if (item.title.includes('杂发')) {
								url = '/pages/special/wm_msic_ship?pkOrder=' + item.pkOrder + "&status=" + item
									.status + "&title=" + item.title + "&id=" + item.id + "&index=" + this
									.index;
							} else if (item.title.includes('返工入库') || item.title.includes('调入')) {
								url = '/pages/product_recpt/reworkIn?pkOrder=' + item.pkOrder + "&status=" +
									item.status + "&title=" + item.title + "&id=" + item.id + "&index=" + this
									.index;
							} else if (item.title.includes('返工出库') || item.title.includes('调出')) {
								url = '/pages/product_recpt/reworkOut?pkOrder=' + item.pkOrder + "&status=" +
									item.status + "&title=" + item.title + "&id=" + item.id + "&index=" + this
									.index;
							}
							uni.navigateTo({
								url: url
							});
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							return;
						}

					},
				})
			},

			actionsClickOut(type, item) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var status = '';
				if (type == "挂起") {
					if (item.status == '0') {
						//隐藏加载框
						uni.hideLoading();
						uni.showToast({
							title: '此待办未领取，不能挂起！',
							icon: 'none',
							duration: 2000
						});
						return;
					}
					status = '2';
				} else if (type == "恢复") {
					if (item.status == '0') {
						//隐藏加载框
						uni.hideLoading();
						uni.showToast({
							title: '此待办未领取，不能恢复！',
							icon: 'none',
							duration: 2000
						});
						return;
					}
					status = '1';
				}
				if (status == null || status == "") {
					return;
				}
				uni.request({
					url: this.baseUrl + '/system/wmsbacklog/update',
					data: {
						id: item.id,
						status: status,
						executor: this.userName,
						orgId: this.orgId,
						startTime: '',
						endTime: '',
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						//隐藏加载框
						uni.hideLoading();
						if (res.data.code == '200' || res.data.code == 200) {
							this.chooseTab(this.index);
							uni.showToast({
								title: '操作成功',
								icon: 'success',
								duration: 2000
							});
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							return;
						}

					},
				})
			},

			alertConfirm(value) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				uni.request({
					url: that.baseUrl + '/system/pdtrcline/returnQty',
					data: {
						orgId: that.orgId,
						userName: that.userName,
						recptId: that.recptId
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						console.log(res)
						if (res.data.code == '200' || res.data.code == 200) {
							if (value == null || value == '') {
								value = '0';
							}
							var jumpNum = res.data.data.jumpNum;
							if (jumpNum == null || jumpNum == '') {
								jumpNum = '0';
							}
							var standardNum = res.data.data.standardNum;
							if (standardNum == null || standardNum == '') {
								standardNum = '0';
							}
							var sumNum = res.data.data.sumNum;
							if (sumNum == null || sumNum == '') {
								sumNum = '0';
							}
							var flag = false;
							// if(parseInt(value) == parseInt(sumNum)){
							// 	flag = true;
							// }else{
							// 	if(parseInt(value) == parseInt(standardNum)){
							// 		flag = true;
							// 	}else{
							// 		if(parseInt(value) + parseInt(jumpNum) == parseInt(sumNum)){
							// 			flag = true;
							// 		}
							// 	}								
							// }
							console.log(parseInt(value))
							console.log(parseInt(standardNum))
							if (parseInt(value) == parseInt(standardNum)) {
								flag = true;
							}
							if (flag) {
								uni.request({
									url: that.baseUrl + '/system/wmsbacklog/update',
									data: {
										id: that.record.id,
										status: '1',
										executor: that.userName,
										orgId: that.orgId,
										startTime: new Date().toISOString().slice(0, 10),
										endTime: '',
									},
									method: 'POST',
									header: {
										'authorization': getToken()
									},
									dataType: 'json',
									success: (res) => {
										console.log(res)
										//隐藏加载框
										uni.hideLoading();
										if (res.data.code == '200' || res.data.code == 200) {
											that.chooseTab(that.index);
											var url = '/pages/work/product_recpt?pkOrder=' + that
												.record.pkOrder + "&status=1" + "&title=" + that
												.record.title + "&id=" + that.record.id +
												"&index=" + that.index;
											uni.navigateTo({
												url: url
											});
											that.$refs.alertDialog.close();
										} else {
											var title = res.data.msg;
											if (title == null || title == '') {
												title = '操作失败';
											}
											uni.showToast({
												title: title,
												icon: 'none',
												duration: 2000
											});
											return;
										}

									},
								})

							} else {
								uni.showModal({
									title: '提示',
									content: '数量输入不正确是否退回此待办任务?',
									success: function(res) {
										if (res.confirm) {
											that.deleteTask();
										} else {
											//隐藏加载框
											uni.hideLoading();
										}
									}
								})
							}
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 5000
							});
							return;
						}

					},
				})
			},

			deleteTask() {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				//console.log(that.record.pkOrder);
				uni.request({
					url: that.baseUrl + '/system/wmsbacklog/cx/del/ins',
					data: {
						orgId: that.orgId,
						userName: that.userName,
						id: that.record.id,
						endMember: that.record.startMember,
						recptId: that.record.pkOrder,
						category: 'WmProductCheck',
						startTime: new Date().toISOString().slice(0, 10),
						endTime: '',
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						//隐藏加载框
						uni.hideLoading();
						if (res.data.code == '200' || res.data.code == 200) {
							that.chooseTab(that.index);
							that.$refs.alertDialog.close();
							//that.updateAttr4(that.record.pkOrder);
							uni.showToast({
								title: '操作成功',
								icon: 'none',
								duration: 5000
							});
						} else {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 5000
							});
							return;
						}

					},
				})
			},

			updateAttr4(recptId) {
				var that = this;
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				uni.request({
					url: that.baseUrl + '/system/pdtrcline/CheckFalse',
					data: {
						orgId: that.orgId,
						userName: that.userName,
						recptId: recptId,
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						//隐藏加载框
						uni.hideLoading();
						if (res.data.code == '200' || res.data.code == 200) {
							uni.showToast({
								title: '操作成功',
								icon: 'none',
								duration: 5000
							});
						} else {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 5000
							});
							return;
						}

					},
				})
			},

			alertClose() {
				this.$refs.alertDialog.close();
			},


			transferClick(item) {
				var that = this;
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				if (item.status == '2' || item.status == '3' || item.status == '4') {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '已挂起或者已完成的待办不允许转单',
						icon: 'none',
						duration: 2000
					});
					return;
				}
				uni.request({
					url: that.baseUrl + '/system/user/sameLeveUsers',
					data: {
						orgId: that.orgId,
						userName: that.userName,
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						if (res.data.code == '200' || res.data.code == 200) {
							var rows = res.data.rows;
							if (rows.length == 0) {
								//隐藏加载框
								uni.hideLoading();
								uni.showToast({
									title: '无可选择的人员',
									icon: 'success',
									duration: 2000
								});
								return;
							} else {
								var list = [];
								for (var i = 0; i < rows.length; i++) {
									list.push(rows[i].userName);
								}
								//list.push("张三");
								//list.push("李四");
								uni.showActionSheet({
									itemList: list,
									success(res) {
										// 选择其中任意一项后，获取其索引（res.tapIndex），从0开始
										//console.log(res.tapIndex) 
										//console.log(item)
										var name = list[res.tapIndex];
										that.updateUser(name, item.pkOrder, item.id);
									},
									fail(res) {
										//隐藏加载框
										uni.hideLoading();
									}
								})
							}
						} else {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 5000
							});
							return;
						}

					},
				})
			},
			// 返还代办进入详情
			returnWarehouseClick(item) {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				if (item.status == '0') {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '请先领取任务',
						icon: 'none',
						duration: 3000
					});
					return;
				}
				var url = '';
				console.log(item)
				if (item.title.includes('上架单')) {
					url = '/pages/work/return_warehouse?pkOrder=' + item.pkOrder + "&status=" + item.status + "&title=" +
						item
						.title + "&id=" + item.id + "&index=" + this.index;
				}
				//隐藏加载框
				uni.hideLoading();
				uni.navigateTo({
					url: url
				});
			},
			// 下架待办进入详情
			dowmshelfClick() {

			},

			updateUser(name, pkOrder, id) {
				var type = "";
				if (this.index == 2) {
					type = "WmPackagePlan";
				} else if (this.index == 6) {
					type = "WmTruckLoading";
				}
				uni.request({
					url: this.baseUrl + '/system/wmsbacklog/zd',
					data: {
						pkOrder: pkOrder,
						id: id,
						userName: this.userName,
						orgId: this.orgId,
						endMember: name,
						orderType: type
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						//隐藏加载框
						uni.hideLoading();
						if (res.data.code == '200' || res.data.code == 200) {
							uni.showToast({
								title: '转单成功',
								icon: 'none',
								duration: 2000
							});
							this.chooseTab(this.index);
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							return;
						}

					},
				})
			},

			allData() {
				var that = this;
				if (that.index == 1) { //入库作业
					//that.packageInDatas = that.packageInDatasCopy;
					that.packageInDatas = [];
					that.delayloadDp(that.packageInDatasCopy, 5, 0, that.delay, that.packageInDatas);
				} else if (that.index == 2) { //出库作业
					//that.packageOutDatas = that.packageOutDatasCopy;
					that.packageOutDatas = [];
					that.delayloadDp(that.packageOutDatasCopy, 5, 0, that.delay, that.packageOutDatas);
				} else if (that.index == 4) { //出库作业
					//that.specialDatas = that.specialDatasCopy;
					that.specialDatas = [];
					that.delayloadDp(that.specialDatasCopy, 5, 0, that.delay, that.specialDatas);
				} else if (that.index == 5) { //出库作业
					//that.checkDatas = that.checkDatasCopy;
					that.checkDatas = [];
					that.delayloadDp(that.checkDatasCopy, 5, 0, that.delay, that.checkDatas);
				} else if (that.index == 6) { //出库作业
					//that.loadingDatas = that.loadingDatasCopy;
					that.loadingDatas = [];
					that.delayloadDp(that.loadingDatasCopy, 5, 0, that.delay, that.loadingDatas);
				} else if (that.index == 3) { //库内作业
					//that.packageDatas = that.packageDatasCopy;
					that.packageDatas = [];
					that.delayloadDp(that.packageDatasCopy, 5, 0, that.delay, that.packageDatas);
				} else if (that.index == 7) {
					//that.checkOrderDatas = that.checkOrderDatasCopy;
					that.checkOrderDatas = [];
					that.delayloadDp(that.checkOrderDatasCopy, 5, 0, that.delay, that.checkOrderDatas);
				} else if (that.index == 9) {
					that.returnWarehouseDatas = [];
					that.delayloadDp(that.returnWarehouseDatasCopy, 5, 0, that.delay, that.returnWarehouseDatas);
				}
				//uni.hideLoading();
				setTimeout(function() {
					//隐藏加载框
					uni.hideLoading();
				}, 1000);
			},

			//未领取
			notClaimed() {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				if (that.index == 1) { //入库作业
					var tempList = [];
					for (var i = 0; i < that.packageInDatasCopy.length; i++) {
						var data = that.packageInDatasCopy[i];
						if (data.status == '0') {
							tempList.push(data);
						}
					}
					that.packageInDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.packageInDatas);
				} else if (that.index == 2) { //出库作业
					var tempList = [];
					for (var i = 0; i < that.packageOutDatasCopy.length; i++) {
						var data = that.packageOutDatasCopy[i];
						if (data.status == '0') {
							tempList.push(data);
						}
					}
					that.packageOutDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.packageOutDatas);
				} else if (that.index == 3) { //出库作业
					var tempList = [];
					for (var i = 0; i < that.packageDatasCopy.length; i++) {
						var data = that.packageDatasCopy[i];
						if (data.status == '0') {
							tempList.push(data);
						}
					}
					that.packageDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.packageDatas);
				} else if (that.index == 4) { //出库作业
					var tempList = [];
					for (var i = 0; i < that.specialDatasCopy.length; i++) {
						var data = that.specialDatasCopy[i];
						if (data.status == '0') {
							tempList.push(data);
						}
					}
					that.specialDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.specialDatas);
				} else if (that.index == 5) { //出库作业
					var tempList = [];
					for (var i = 0; i < that.checkDatasCopy.length; i++) {
						var data = that.checkDatasCopy[i];
						if (data.status == '0') {
							tempList.push(data);
						}
					}
					that.checkDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.checkDatas);
				} else if (that.index == 6) { //出库作业
					var tempList = [];
					for (var i = 0; i < that.loadingDatasCopy.length; i++) {
						var data = that.loadingDatasCopy[i];
						if (data.status == '0') {
							tempList.push(data);
						}
					}
					that.loadingDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.loadingDatas);
				} else if (that.index == 7) {
					var tempList = [];
					for (var i = 0; i < that.checkOrderDatasCopy.length; i++) {
						var data = that.checkOrderDatasCopy[i];
						console.log(data)
						if (data.status == '0') {
							tempList.push(data);
						}
					}
					that.checkOrderDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.checkOrderDatas);
				}
				//uni.hideLoading();
				setTimeout(function() {
					//隐藏加载框
					uni.hideLoading();
				}, 1000);
			},
			//进行中
			inHand() {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				if (that.index == 1) { //入库作业
					var tempList = [];
					for (var i = 0; i < that.packageInDatasCopy.length; i++) {
						var data = that.packageInDatasCopy[i];
						if (data.status != '0' && data.status != '3' && data.status != '4') {
							tempList.push(data);
						}
					}
					that.packageInDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.packageInDatas);
				} else if (that.index == 2) { //出库作业
					var tempList = [];
					for (var i = 0; i < that.packageOutDatasCopy.length; i++) {
						var data = that.packageOutDatasCopy[i];
						if (data.status != '0' && data.status != '3' && data.status != '4') {
							tempList.push(data);
						}
					}
					that.packageOutDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.packageOutDatas);
				} else if (that.index == 3) { //出库作业
					var tempList = [];
					for (var i = 0; i < that.packageDatasCopy.length; i++) {
						var data = that.packageDatasCopy[i];
						if (data.status != '0' && data.status != '3' && data.status != '4') {
							tempList.push(data);
						}
					}
					that.packageDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.packageDatas);
				} else if (that.index == 4) { //出库作业
					var tempList = [];
					for (var i = 0; i < that.specialDatasCopy.length; i++) {
						var data = that.specialDatasCopy[i];
						if (data.status != '0' && data.status != '3' && data.status != '4') {
							tempList.push(data);
						}
					}
					that.specialDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.specialDatas);
				} else if (that.index == 5) { //出库作业
					var tempList = [];
					for (var i = 0; i < that.checkDatasCopy.length; i++) {
						var data = that.checkDatasCopy[i];
						if (data.status != '0' && data.status != '3' && data.status != '4') {
							tempList.push(data);
						}
					}
					that.checkDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.checkDatas);
				} else if (that.index == 6) { //出库作业
					var tempList = [];
					for (var i = 0; i < that.loadingDatasCopy.length; i++) {
						var data = that.loadingDatasCopy[i];
						if (data.status != '0' && data.status != '3' && data.status != '4') {
							tempList.push(data);
						}
					}
					that.loadingDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.loadingDatas);
				} else if (that.index == 7) {
					var tempList = [];
					for (var i = 0; i < that.checkOrderDatasCopy.length; i++) {
						var data = that.checkOrderDatasCopy[i];
						if (data.status != '0' && data.status != '3' && data.status != '4') {
							tempList.push(data);
						}
					}
					that.checkOrderDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.checkOrderDatas);
				} else if (that.index == 9) {
					var tempList = [];
					for (var i = 0; i < that.returnWarehouseDatasCopy.length; i++) {
						var data = that.returnWarehouseDatasCopy[i];
						if (data.status != '0' && data.status != '3' && data.status != '4') {
							tempList.push(data);
						}
					}
					that.returnWarehouseDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.returnWarehouseDatas);
				}
				//隐藏加载框
				//uni.hideLoading();
				setTimeout(function() {
					//隐藏加载框
					uni.hideLoading();
				}, 1000);
			},
			//已完成
			completed() {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				if (that.index == 1) { //入库作业
					var tempList = [];
					for (var i = 0; i < that.packageInDatasCopy.length; i++) {
						var data = that.packageInDatasCopy[i];
						if (data.status == '3' || data.status == '4') {
							tempList.push(data);
						}
					}
					that.packageInDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.packageInDatas);
				} else if (that.index == 2) { //出库作业,组托
					var tempList = [];
					for (var i = 0; i < that.packageOutDatasCopy.length; i++) {
						var data = that.packageOutDatasCopy[i];
						if (data.status == '3' || data.status == '4') {
							tempList.push(data);
						}
					}
					that.packageOutDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.packageOutDatas);
				} else if (that.index == 3) { //出库作业
					var tempList = [];
					for (var i = 0; i < that.packageDatasCopy.length; i++) {
						var data = that.packageDatasCopy[i];
						if (data.status == '3' || data.status == '4') {
							tempList.push(data);
						}
					}
					that.packageDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.packageDatas);
				} else if (that.index == 4) {
					var tempList = [];
					for (var i = 0; i < that.specialDatasCopy.length; i++) {
						var data = that.specialDatasCopy[i];
						if (data.status == '3' || data.status == '4') {
							tempList.push(data);
						}
					}
					that.specialDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.specialDatas);
				} else if (that.index == 5) { //出库作业，装车
					var tempList = [];
					for (var i = 0; i < that.checkDatasCopy.length; i++) {
						var data = that.checkDatasCopy[i];
						if (data.status == '3' || data.status == '4') {
							tempList.push(data);
						}
					}
					that.checkDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.checkDatas);
				} else if (that.index == 6) { //出库作业，装车
					var tempList = [];
					for (var i = 0; i < that.loadingDatasCopy.length; i++) {
						var data = that.loadingDatasCopy[i];
						if (data.status == '3' || data.status == '4') {
							tempList.push(data);
						}
					}
					that.loadingDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.loadingDatas);
				} else if (that.index == 7) {
					var tempList = [];
					for (var i = 0; i < that.checkOrderDatasCopy.length; i++) {
						var data = that.checkOrderDatasCopy[i];
						if (data.status == '3' || data.status == '4') {
							tempList.push(data);
						}
					}
					that.checkOrderDatas = [];
					that.delayloadDp(tempList, 5, 0, that.delay, that.checkOrderDatas);
				}
				//uni.hideLoading();
				setTimeout(function() {
					//隐藏加载框
					uni.hideLoading();
				}, 1000);
			},

			commonConfirm() {
				this.commonContent = "";
				this.$refs.commonDialog.close();
			},

			commonClose() {
				this.commonContent = "";
				this.$refs.commonDialog.close();
			},

			delayloadDp(list, pageSize, current, delay, showList) {
				//延时加载
				if (current != 0) {
					current++;
				}
				for (let i = current; i < list.length; i++) {
					showList.push(list[i]);
					current = i;
					if (i != 0 && i % pageSize == 0) {
						break;
					}
				}
				if (showList.length == list.length) {
					return;
				}
				setTimeout(() => {
					this.delayloadDp(list, pageSize, current, delay, showList)
				}, 200 + delay)
			},
		}
	}
</script>
<style lang="scss">
	.card-actions {
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		align-items: center;
		height: 45px;
		border-top: 1px #eee solid;
	}

	.dangerMsgbox {
		border: #FF0000 1rpx solid;
	}

	.content {
		.tabs {
			height: 60rpx;
			display: flex;
			margin-top: 10rpx;

			.tabs-item {
				// 平均分布
				flex: 1;
				text-align: center;
				color: #111111;
				height: 60rpx;
				line-height: 60rpx;
				display: inline-block;
				padding: 6px 20px;
				margin: 0 5px;
			}

			.tabs-item-tag {
				color: #5BA7FF;
				border-bottom: 4rpx solid #5BA7FF;
			}
		}

		.button {
			height: 60rpx;
			display: flex;
			margin-top: 35rpx;

			.button-item {
				// 平均分布
				flex: 1;
				text-align: center;
				color: #111111;
				height: 60rpx;
				line-height: 60rpx;
				background-color: #FFF;
			}

			.button-item-tag {
				/* color: #5BA7FF;
			    border-bottom: 4rpx solid #5BA7FF; */
				background-color: #DDD;
			}
		}

		.item {
			padding: 10rpx;
			display: grid;

			image {
				width: 400rpx;
				margin: auto;
				margin-top: 100rpx;
			}

			text {
				text-align: center;
			}
		}

		.scroll-Y {
			height: 1100rpx;
		}

		.uni-swiper-tab {
			white-space: nowrap;
			display: flex;
			justify-content: flex-start;
		}

		.scrollx_item {
			display: inline-block;
			padding: 6px 20px;
			margin: 0 20px;
			border: 1px solid #eee;
			border-radius: 14px;
		}
	}
</style>